package com.hk.Mgr.web.controller.app;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hk.Mgr.web.message.SessionConstants;
import com.hk.Mgr.web.message.StatusCode;
import com.hk.Mgr.web.message.Token;
import com.hk.Mgr.web.message.sys.SysUserReq;
import com.hk.Mgr.web.message.sys.SysUserRes;
import com.hk.base.BaseCtrl;
import com.hk.base.ResponseBase;
import com.hk.commons.ConstantParm;
import com.hk.commons.ReqToModelHelper;
import com.hk.commons.SqlFilter;
import com.hk.commons.entity.Organization;
import com.hk.commons.entity.Parameter;
import com.hk.commons.entity.sys.SysResource;
import com.hk.commons.entity.sys.SysRole;
import com.hk.commons.entity.sys.SysUser;
import com.hk.commons.entity.sys.SysUserRoles;
import com.hk.commons.utils.sys.MD5Crypter;
import com.hk.service.IOrganization;
import com.hk.service.order.IParameter;
import com.hk.service.sys.ISysModuleResource;
import com.hk.service.sys.ISysResource;
import com.hk.service.sys.ISysRole;
import com.hk.service.sys.ISysRoleModules;
import com.hk.service.sys.ISysUser;
import com.hk.service.sys.ISysUserRoles;

/**
 * @author lemon 用户实现类
 */
@Controller
@RequestMapping(value = BaseCtrl.App + "/parmCtrl")
public class ParmCtrl extends BaseCtrl {

	 
	@Autowired
	private IParameter parmService;

	/**
	 * @Title: getSysUserById
	 * @Description: 根据id获取用户
	 * @param
	 */
	@ResponseBody
	@RequestMapping(value = "/getPvUrlParm")
	public ResponseBase<String> getPvUrl() {
		ResponseBase<String> resp = new ResponseBase<String>();
		try{
		 	Parameter parm = parmService.getByName(ConstantParm.ANDROID_PV_URL);
		 	
		 	if(parm != null && parm.getValue01() != null){
		 		resp.setResult(parm.getValue01());
		 		resp.setResultCode(StatusCode.SUCCESS.key());
		 	}else{
		 		resp.setResult(null);
		 		resp.setResultCode(StatusCode.ERROR.key());
		 	}
			
		} catch (Exception ex) {
			logger.error(ex.getMessage(), ex);
			resp.setMsg("操作异常，请重试");
			resp.setResultCode(StatusCode.EXCEPTION.key());
		}
		return resp;
	}
}
